/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hibernate.dao;

import hibernate.entity.Attachments;

/**
 *
 * @author NDH
 */
public class AttachmentDAO extends AbstractDAO {

    /**
     * @param Attachments an attachment's info to create new one
     * @return int
     */
    public int create(Attachments att) {
        try {
            tx = session.beginTransaction();
            session.save(att);
            tx.commit();
            return 1;
        } catch (Exception e) {
            return 0;
        }

    }
}
